require('./PagePersonalinfo.styl');
import { Boxs, NavBar, Group, PickerField, Context } from 'saltui';
import { Control } from 'react-keeper'
const reactMixin = require('react-mixin');
const Actions = require('./actions');
const Store = require('./store');
const DetailFlow = require('components/detailwrap');
class Personalinfo extends React.Component {

    constructor(props) {
        super(props);
        this.state = {
            headData: '',
            itemData: '',
            warnList: []
        };
        this.handleOnLeftClick = this.handleOnLeftClick.bind(this)
    }
    handleOnLeftClick() {
        Control.go(-1)
    }
    render() {
        let t = this;
        return (
            <div className="personalinfo">
                <NavBar
                    className={this.state.className}
                    isShow={false}
                    title=''
                    onLeftClick={this.handleOnLeftClick.bind(this)}
                    onRightClick={Context.noop}
                    rightText=''
                />
                {this.state.headData && <DetailFlow.Head {...t.state.headData} />}
                {this.state.itemData && <DetailFlow.Item {...t.state.itemData} />}
                {this.state.warnList.length > 0 &&
                    <DetailFlow.ItemList warnList={t.state.warnList} />}
            </div>
        );
    }

    componentWillMount() {
    }

    componentDidMount() {
        Actions.fetchStudentInfo(Control.state.data)
    }

    componentWillReceiveProps(nextProps) {
    }

    shouldComponentUpdate(nextProps, nextState) {
        return true;
    }

    componentWillUpdate(nextProps, nextState) {
    }

    componentDidUpdate(prevProps, prevState) {
    }

    componentWillUnmount() {
    }
}

reactMixin.onClass(Personalinfo, Reflux.connect(Store));

module.exports = Personalinfo;
